{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>距离列表</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--角色模板-->
                    <script type="text/html" id="titleTpl">
                        {{# if(d.title == null){ }}
                        <span style="color:#ec4758">重新分配角色</span>
                        {{# }else{ }}
                        {{d.title}}
                        {{# } }}
                    </script>
                    <!--状态模板-->
                    <script type="text/html" id="staBar">
                        {{# if(d.id!==1){ }}
                        <input type="hidden" id="zh{{d.id}}" value="{{d.status}}">
                        <input type="checkbox"  id="zt{{d.id}}" value="{{d.id}}"  lay-skin="switch"  lay-text="ON|OFF" lay-filter="OnOff"{{ d.status == 1 ? 'checked' : '' }}  >
                        {{# } }}
                    </script>
                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        <a href="javascript:;"onclick="wk.layer_show('编辑距离','{:url('distanceEdit')}?id={{d.juli_id}}',900)" class="btn btn-primary btn-xs m-r-xs" title="编辑"><i class="fa fa-pencil"></i></a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Distance/index")}'
            , page: false
            , even: false //开启隔行背景
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            // ,width:100
            , cellMinWidth: 150
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'juli_value', width: '', title: '距离', align: 'center'}
                , {field: 'remark', width: '', title: '备注', align: 'center'}
                , {field: 'update_time', width: '', title: '修改时间', align: 'center'}
                , {fixed: 'right', width: 100, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
        });
    });
</script>
</body>
</html>